package cn.wolfcode.luowowo.redis.util;

import cn.wolfcode.luowowo.util.Consts;
import lombok.Getter;

@Getter
public enum RedisKeys {


    VERIFY_CODE("verify_code", Consts.VERIFY_CODE_VAI_TIME * 60L),
    LOGIN_TOKEN("login_token", Consts.USER_INFO_TOKEN_VAI_TIME * 60L),
    STATISVO("VO", -1L),
    FAVOR("favornum_add", -1L),
    STRATEGYTHUMBUP("strategyThumbup",-1L)
    ;
    private String prefix;
    private Long time;

    private RedisKeys(String prefix, Long time) {
        this.prefix = prefix;
        this.time = time;
    }

    public String json(String... values) {
        StringBuilder sb = new StringBuilder(80);

        sb.append(this.prefix);
        for (String s : values) {
            sb.append(":").append(s);
        }
        return sb.toString();
    }
}
